package com.workspace.chb_website.controller;

import com.workspace.chb_website.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@CrossOrigin
@Controller
public class Debug {

    private final UserMapper userMapper;

    @Autowired
    public Debug(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @GetMapping("/debug")
    public String debug(HttpServletResponse response) throws Exception {
        return "redirect:https://www.baidu.com";
        //response.sendRedirect("https://www.baidu.com");
    }
}
